package cn.zh.npro;

import android.app.Application;
import android.content.SharedPreferences;

import com.lzy.okhttputils.OkHttpUtils;
import com.pgyersdk.crash.PgyCrashManager;
import com.pgyersdk.update.PgyUpdateManager;

import java.util.ArrayList;
import java.util.logging.Handler;

import cn.zh.npro.Item.AcLItem;
import cn.zh.npro.Item.CityTem;
import cn.zh.npro.Util.CityListLoader;

/**
 * Created by WYN on 2018/2/28 0028.
 */

public class MyApplication extends Application {

    SharedPreferences sp=null;

    boolean isld=false;

    CityTem proviece,cityitem,areaim;

    boolean iscity=false;
    //判断哪个activity选择城市
    int arechose=1;

    ArrayList<AcLItem> macLItems=new ArrayList<>();

    String clID="",traId="";

    public static Application getsInstance() {
        return sInstance;
    }

    public static void setsInstance(Application sInstance) {
        MyApplication.sInstance = sInstance;
    }

    private static Application sInstance;


    @Override
    public void onCreate() {
        super.onCreate();
        sInstance = this;
        OkHttpUtils.init(this);
        sp=getSharedPreferences("Unites",MODE_PRIVATE);
        CityListLoader.getInstance().loadProData(this);
        PgyUpdateManager.setIsForced(false);
        PgyCrashManager.register(this);
    }


    public SharedPreferences getSp() {
        return sp;
    }

    public void setSp(SharedPreferences sp) {
        this.sp = sp;
    }

    public boolean isIsld() {
        return isld;
    }

    public void setIsld(boolean isld) {
        this.isld = isld;
    }

    public CityTem getProviece() {
        return proviece;
    }

    public void setProviece(CityTem proviece) {
        this.proviece = proviece;
    }

    public CityTem getCityitem() {
        return cityitem;
    }

    public void setCityitem(CityTem cityitem) {
        this.cityitem = cityitem;
    }

    public CityTem getAreaim() {
        return areaim;
    }

    public void setAreaim(CityTem areaim) {
        this.areaim = areaim;
    }

    public boolean isIscity() {
        return iscity;
    }

    public void setIscity(boolean iscity) {
        this.iscity = iscity;
    }

    public int getArechose() {
        return arechose;
    }

    public void setArechose(int arechose) {
        this.arechose = arechose;
    }

    public ArrayList<AcLItem> getMacLItems() {
        return macLItems;
    }

    public void setMacLItems(ArrayList<AcLItem> macLItems) {
        this.macLItems = macLItems;
    }

    public String getClID() {
        return clID;
    }

    public void setClID(String clID) {
        this.clID = clID;
    }

    public String getTraId() {
        return traId;
    }

    public void setTraId(String traId) {
        this.traId = traId;
    }


}
